{
    "version": "0.2.12",
    "name": "org.apache.cordova.network-information",
    "cordova_name": "Network Information",
    "description": "Cordova Network Information Plugin",
    "license": "Apache 2.0",
    "repo": "https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git",
    "issue": "https://issues.apache.org/jira/browse/CB/component/12320640",
    "keywords": [
        "cordova",
        "network",
        "information"
    ],
    "platforms": [
        "firefoxos",
        "android",
        "amazon-fireos",
        "ubuntu",
        "ios",
        "blackberry10",
        "wp7",
        "wp8",
        "windows8",
        "tizen",
        "browser"
    ],
    "engines": [],
    "englishdoc": "<!---\n    Licensed to the Apache Software Foundation (ASF) under one\n    or more contributor license agreements.  See the NOTICE file\n    distributed with this work for additional information\n    regarding copyright ownership.  The ASF licenses this file\n    to you under the Apache License, Version 2.0 (the\n    \"License\"); you may not use this file except in compliance\n    with the License.  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing,\n    software distributed under the License is distributed on an\n    \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n    KIND, either express or implied.  See the License for the\n    specific language governing permissions and limitations\n    under the License.\n-->\n\n# org.apache.cordova.network-information\n\nThis plugin provides an implementation of an old version of the\n[Network Information API](http://www.w3.org/TR/2011/WD-netinfo-api-20110607/).\nIt provides information about the device's cellular and\nwifi connection, and whether the device has an internet connection.\n\n## Installation\n\n    cordova plugin add org.apache.cordova.network-information\n\n## Supported Platforms\n\n- Amazon Fire OS\n- Android\n- BlackBerry 10\n- Browser\n- iOS\n- Windows Phone 7 and 8\n- Tizen\n- Windows 8\n- Firefox OS\n\n# Connection\n\n> The `connection` object, exposed via `navigator.connection`,  provides information about the device's cellular and wifi connection.\n\n## Properties\n\n- connection.type\n\n## Constants\n\n- Connection.UNKNOWN\n- Connection.ETHERNET\n- Connection.WIFI\n- Connection.CELL_2G\n- Connection.CELL_3G\n- Connection.CELL_4G\n- Connection.CELL\n- Connection.NONE\n\n## connection.type\n\nThis property offers a fast way to determine the device's network\nconnection state, and type of connection.\n\n### Quick Example\n\n    function checkConnection() {\n        var networkState = navigator.connection.type;\n\n        var states = {};\n        states[Connection.UNKNOWN]  = 'Unknown connection';\n        states[Connection.ETHERNET] = 'Ethernet connection';\n        states[Connection.WIFI]     = 'WiFi connection';\n        states[Connection.CELL_2G]  = 'Cell 2G connection';\n        states[Connection.CELL_3G]  = 'Cell 3G connection';\n        states[Connection.CELL_4G]  = 'Cell 4G connection';\n        states[Connection.CELL]     = 'Cell generic connection';\n        states[Connection.NONE]     = 'No network connection';\n\n        alert('Connection type: ' + states[networkState]);\n    }\n\n    checkConnection();\n\n\n### API Change\n\nUntil Cordova 2.3.0, the `Connection` object was accessed via\n`navigator.network.connection`, after which it was changed to\n`navigator.connection` to match the W3C specification.  It's still\navailable at its original location, but is deprecated and will\neventually be removed.\n\n### iOS Quirks\n\n- iOS can't detect the type of cellular network connection.\n    - `navigator.connection.type` is set to `Connection.CELL` for all cellular data.\n\n### Windows Phone Quirks\n\n- When running in the emulator, always detects `navigator.connection.type` as `Connection.UNKNOWN`.\n\n- Windows Phone can't detect the type of cellular network connection.\n    - `navigator.connection.type` is set to `Connection.CELL` for all cellular data.\n\n### Tizen Quirks\n\n- Tizen can only detect a WiFi or cellular connection.\n    - `navigator.connection.type` is set to `Connection.CELL_2G` for all cellular data.\n\n### Firefox OS Quirks\n\n- Firefox OS can't detect the type of cellular network connection.\n    - `navigator.connection.type` is set to `Connection.CELL` for all cellular data.\n\n# Network-related Events\n\n## offline\n\nThe event fires when an application goes offline, and the device is\nnot connected to the Internet.\n\n    document.addEventListener(\"offline\", yourCallbackFunction, false);\n\n### Details\n\nThe `offline` event fires when a previously connected device loses a\nnetwork connection so that an application can no longer access the\nInternet.  It relies on the same information as the Connection API,\nand fires when the value of `connection.type` becomes `NONE`.\n\nApplications typically should use `document.addEventListener` to\nattach an event listener once the `deviceready` event fires.\n\n### Quick Example\n\n    document.addEventListener(\"offline\", onOffline, false);\n\n    function onOffline() {\n        // Handle the offline event\n    }\n\n\n### iOS Quirks\n\nDuring initial startup, the first offline event (if applicable) takes at least a second to fire.\n\n### Windows Phone 7 Quirks\n\nWhen running in the Emulator, the `connection.status` is always unknown, so this event does _not_ fire.\n\n### Windows Phone 8 Quirks\n\nThe Emulator reports the connection type as `Cellular`, which does not change, so the event does _not_ fire.\n\n## online\n\nThis event fires when an application goes online, and the device\nbecomes connected to the Internet.\n\n    document.addEventListener(\"online\", yourCallbackFunction, false);\n\n### Details\n\nThe `online` event fires when a previously unconnected device receives\na network connection to allow an application access to the Internet.\nIt relies on the same information as the Connection API,\nand fires when the `connection.type` changes from `NONE` to any other\nvalue.\n\nApplications typically should use `document.addEventListener` to\nattach an event listener once the `deviceready` event fires.\n\n### Quick Example\n\n    document.addEventListener(\"online\", onOnline, false);\n\n    function onOnline() {\n        // Handle the online event\n    }\n\n\n### iOS Quirks\n\nDuring initial startup, the first `online` event (if applicable) takes\nat least a second to fire, prior to which `connection.type` is\n`UNKNOWN`.\n\n### Windows Phone 7 Quirks\n\nWhen running in the Emulator, the `connection.status` is always unknown, so this event does _not_ fire.\n\n### Windows Phone 8 Quirks\n\nThe Emulator reports the connection type as `Cellular`, which does not change, so events does _not_ fire.\n"
}